const express = require('express');
const router = express.Router();
const {asyncHandler} = require('../utils/sendResult');
const {queryFeedback,addFeedback} = require("../services/feedbackServices");

router.get("/",asyncHandler((req,res,next)=>{
    // 分页查询意见反馈
    return queryFeedback(req.query)
}))

// 添加意见反馈
router.post("/",asyncHandler((req,res,next)=>{
    req.body.userId = req.userInfo._id;
    return addFeedback(req.body)
}))


module.exports = router;
